package com.itheima.mall.service.umsService;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class UmsRoleMenuRelationService {

    @DubboReference
    private UmsRoleMenuRelationApi umsRoleMenuRelationApi;

    /**
     * 给角色分配菜单
     * @param menuIds 分配的菜单数组
     * @param roleId 角色ID
     * @return
     */
    public void allocMenu(ArrayList<Long> menuIds, Long roleId) {
        umsRoleMenuRelationApi.allocMenu(menuIds,roleId);
    }

    /**
     * 根据角色ID查询关联菜单IDS数组
     * @param roleId 角色ID
     * @return
     */
    public ArrayList<Long> getmenuIds(long roleId) {
        return umsRoleMenuRelationApi.getmenuIds(roleId);
    }
}
